if __name__ == '__main__':
    while True:
        first_num = input("Please input the first number: ")
        symbol = input("Please input +, -, *, or /: ")
        second_num = input("Please input the second number: ")

        if not first_num.isdigit() or not second_num.isdigit():
            print("Both input numbers must be integers. Please try again.")
            continue  # 继续循环以重新输入

        first_num = int(first_num)
        second_num = int(second_num)

        if symbol not in ('+', '-', '*', '/'):
            print("Invalid operator. Please use +, -, *, or /.")
            continue  # 继续循环以重新输入

        if symbol == "+":
            result = first_num + second_num
        elif symbol == "-":
            result = first_num - second_num
        elif symbol == "*":
            result = first_num * second_num
        elif symbol == "/":
            if second_num == 0:
                print("Division by zero is not allowed.")
                continue  # 继续循环以重新输入
            result = first_num / second_num

        print(f"{first_num} {symbol} {second_num} = {result}")

